@model IEnumerable<ShivamEMR.Model.Domain.PatientDomain.Insurance>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th></th>
        <th>
            CardNo
        </th>
        <th>
            StartDate
        </th>
        <th>
            EndDate
        </th>
        <th>
            Notes
        </th>
        <th>
            Patient
        </th>
        <th>
            Company
        </th>
        <th>
            Plan
        </th>
        <th>
            Category
        </th>
        <th>
            Status
        </th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.ID }) |
            @Html.ActionLink("Details", "Details", new { id=item.ID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.ID })
        </td>
        <td>
			@item.CardNo
        </td>
        <td>
			@String.Format("{0:g}", item.StartDate)
        </td>
        <td>
			@String.Format("{0:g}", item.EndDate)
        </td>
        <td>
			@item.Notes
        </td>
        <td>
			@(item.Patient == null ? "None" : item.Patient.Title)
        </td>
        <td>
			@(item.Company == null ? "None" : item.Company.Name)
        </td>
        <td>
			@(item.Plan == null ? "None" : item.Plan.Name)
        </td>
        <td>
			@Html.DisplayTextFor(_ => item.Category).ToString()
        </td>
        <td>
			@Html.DisplayTextFor(_ => item.Status).ToString()
        </td>
    </tr>
}

</table>


